import request from '@/router/axios';

/**
 * 登录
 * @param tenant
 * @param account
 * @param password
 * @param code
 * @param random
 */
export const login = ({tenant, account, password, code, random}) => {
	return request({
		url: '/auth/token',
		method: 'post',
    params: {
      tenant,
      account,
      password,
      code,
      random
    }
	})
}

/**
 * 刷新令牌
 * @param data
 */
export const refeshToken = data => request({
    url: '/auth/refeshToken',
    method: 'post',
    data
})

/**
 * 登出
 */
export const logout = () => {
  return request({
    url: '/auth/logout',
    method: 'post'
  })
}
